package com.hsd.znsh.utils;

import com.hsd.znsh.entity.SensorType;
import com.hsd.znsh.entity.User;
import com.hsd.znsh.enums.DeletedStatusEnum;
import com.hsd.znsh.enums.ResultEnum;
import com.hsd.znsh.exception.ZnshException;
import com.hsd.znsh.repository.UserRepository;
import org.springframework.util.StringUtils;
import org.springframework.validation.BindingResult;

public class ValidatorUtil {

    public static void valid(BindingResult bindingResult){
        if (bindingResult.hasFieldErrors()) {
            throw new ZnshException(bindingResult.getFieldError().getDefaultMessage());
        }
    }
}
